package cn.lisens.jpa.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.lisens.jpa.domain.User;
import cn.lisens.jpa.service.UserService;

@RestController
@RequestMapping("/user")
public class UserController {

	@Autowired
	private UserService userService;
	
	@RequestMapping("save")
	public String save(User user) {
		userService.save(user);
		return "保存成功";
	}
	
	@RequestMapping("listData")
	public List<User> listData(User user) {
		return userService.findList(user);
	}
}
